package exercise;
/*
 * .css 文件位置 
 * 测试内联 。
 * */
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class DemoButtonUppDate extends Application{

	@Override
	public void start(Stage primaryStage) throws Exception {
		
		Scene scene = new Scene(cteateUi());
		
		scene.getStylesheets().add("styles.css");
		scene.getStylesheets().add("label.css");
		
		primaryStage.setTitle("内联");
		
		primaryStage.setScene(scene);
		
		primaryStage.show();
	}

	private Parent cteateUi() {
		//������ť
		Button button = new Button("QQ图标");
		//����ͼƬ��Ϣ
		Image image = new Image(getClass().getResourceAsStream("QQ.png"));
		//ͼƬ��Ϣ���ӻ�
		ImageView iv = new ImageView(image);
		//�������button�����
		button.setGraphic(iv);
		//��ť������ִ������
		//lamble ���ʽ
		button.setOnAction((e)->{
			System.out.println("看什么看~");
		});
		//�����ڲ���
		/*button.setOnAction(new EventHandler<ActionEvent>() {			
			@Override
			public void handle(ActionEvent event) {
				System.out.println("ûǮ ��nm�أ�~");				
			}
		});*/
		VBox vbox = new VBox();
		
		Button button2 = new Button("btn2");// 根目录
		Label label = new Label("label");//  子目录
		// 
		vbox.getChildren().addAll(label,button2);
		return vbox;
	}
	public static void main(String[] args) {
		Application.launch(args);
	}
}
